/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2011.08.12                                          *
 *                                                                       *
 *************************************************************************/

namespace FreeMAPs
{

inline bool
AttributeInfo::is_empty() const
{
    return d_attrs.empty();
}


inline bool
AttributeInfo::has_attribute (
    const std::string& name) const
{
    return (d_attrs.count (name) > 0);
}


inline const Attribute*
AttributeInfo::get_attribute (
    const std::string& name) const
{
    std::map<std::string, Attribute*>::const_iterator find = d_attrs.find (name);
    FREEMAPS_ASSERT (find != d_attrs.end());
    return find->second;
}


inline const Attribute*
AttributeInfo::get_default_attribute () const
{
    FREEMAPS_ASSERT_VALID_POINTER (d_default_attr);
    return d_default_attr;
}


inline const std::map<std::string, Attribute*>&
AttributeInfo::get_attributes () const
{
    return d_attrs;
}

} //namespace FreeMAPs
